#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
int main(){
  pid_t id = fork();
  if(id == 0){
    //child
    int cnt = 15;
    while(cnt){
      printf("I am child, pid :%d ,ppid : %d\n",getpid(),getppid());
      sleep(1);
      cnt--;
    }
    exit(0);    //让子进程直接退出
  }

  //father
  while(20){
    printf("I am father, pid :%d ,ppid : %d\n",getpid(),getppid());
    sleep(1);
  }











//  int i = 0;
// // while(1){}
//  scanf("%d",&i);
//  printf("i的值是：%d\n",i);
 // while(1){
 //   printf("hello process:%d\n",getpid());
 // }
  return 0;
}
